<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录</title>
</head>
<h4>登录</h4></br>
	<c:set var="ctx" value="${pageContext.request.contextPath}"/>
	<form action="${ctx }/userLogin"  method="post" >
		用户名:<input type="text" name="username" /><br>
		密码:<input type="password" name="password" /><br>

		验证码:<input type="text" name="imageCode" /><br>
		<img id="kaptcha-img" alt="点击更换" title="点击更换"
			 onclick="changeVerifyCode(this)" src="${ctx}/Kaptcha" /><br>
		记住我:<input type="checkbox" name="remember-me" value="true"/><br>
		<input  type = "hidden"  name = "${_csrf.parameterName}" value = "${_csrf.token}" />


		<span style="font-color:red;">${loginmessage }</span><br>
		<input type="submit" value="登录"/> <br>
	</form>
	<a href="#">注册</a>
</body>
<script>
	function changeVerifyCode(img) {
		img.src="${ctx}/Kaptcha?" + Math.floor(Math.random()*100);
	}
</script>
</html>